<template>
	<el-button v-bind="$attrs" v-on="$listeners" @click.prevent="toClick" :loading="loading">
		<slot></slot>
	</el-button>
</template>

<script>
	export default {
		name: "MyButton",
		data() {
			return {
				loading: false,
			};
		},
		methods: {
			toClick() {

				const context = this;

				function ButtonOffset() {}
				ButtonOffset.prototype = {
					loadingOpen() {
						context.loading = true;
					},
					loadingClose() {
						context.loading = false;
					},
				};
				this.$emit("submit", new ButtonOffset());
			},
		},
	};
</script>
<style lang="scss" scoped>
	.el-button{
		height: 80rpx;
		width: 160rpx;
	}
	.el-button--primary {
		background-color: $uni-color-primary;
		border-color:$uni-color-primary;
	}
</style>
